//
//  KJStaticNormalItem.m
//  KJKit
//
//  Created by Tiger on 2022/6/9.
//

#import "KJStaticNormalItem.h"
#import "KJStaticNormalCell.h"

NSString *const kKJStaticNormalItem_cellID = @"KJStaticNormalItem_cellID";

@implementation KJStaticNormalItem

+ (instancetype)itemWithStyle:(UITableViewCellStyle)style
                       Image:(UIImage *)image
                        Title:(NSString *)text
                      Detail:(NSString *)detail
                  Description:(NSString *)description
               SelectedBlock:(KJTableViewItemSelectedBlock)selectedBlock;
{
    KJStaticNormalItem *item = [[KJStaticNormalItem alloc] initWithStyle:UITableViewCellStyleSubtitle Image:image Text:text Detail:detail Description:description SelectedBlock:selectedBlock];
    item.numberOfLinesForTitle = -1;
    item.numberOfLinesForDetail = -1;
    item.numberOfLinesForDescription = -1;
    item.titleDescriptionGap = -1;
    return item;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style
                        Image:(UIImage *)image
                        Text:(NSString *)text
                       Detail:(NSString *)detail
                  Description:(NSString *)description
                SelectedBlock:(KJTableViewItemSelectedBlock)selectedBlock
{
    self = [super init];
    if (self) {
        self.cellStyle = style;
        _image = image;
        _titleText = text;
        _detailText = detail;
        _descriptionText = description;
        self.selectedAction = selectedBlock;
        _titleDescriptionRatio = -1.0f;
        if (self.selectedAction) {
            self.allowSelection = YES;
            self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        }else{
            self.allowSelection = NO;
            self.accessoryType = UITableViewCellAccessoryNone;
        }
    }
    return self;
}


- (Class)cellClass {
    return [KJStaticNormalCell class];
}

- (NSString *)cellID {
    return kKJStaticNormalItem_cellID;
}


@end
